import React, { useEffect, useState } from "react"
import { IRouteComponentProps, Link } from "umi"
import { getDefenceDetail } from "@/services/modules/defence"
import { ISdefenceDetail } from '@/utils/index'
import { Button, Form } from 'antd'
import "./defenceId.less"

const scoreHistory: React.FC<IRouteComponentProps> = ({ match }: any) => {
    console.log(match);
    const [detail, setDetail] = useState<ISdefenceDetail>({} as ISdefenceDetail)
    useEffect(() => {
        getDefenceDetail(match.params.defenceId).then(ok => {
            if (ok.code == 200) {
                setDetail(ok.data)
            }
        })
    }, [])

    return <div className='box_content'>
        <div className='baseinfo'>
            <div className='addProject_title top'>
                <div className='top_right'>
                    <Link to='/teachers/defence/defence'><Button>返回</Button></Link>
                </div>
            </div>
            <Form className='addtask_detail'>
                <div className='detail'>
                    <Form className='el-form'>
                        <div className='el-row'>
                            答辩名称:<p>{detail.degenceName}</p>
                            专业:<p>{detail.majorName}</p>
                        </div>
                        <div className='el-row'>
                            班级计划:<p>{detail.majorName}/{detail.planName}</p>
                            答辩时间:<p>{detail.defenceCreateTime},{detail.defenceEndTime}</p>
                        </div>
                        <div className='el-row'>
                            答辩地址:<p>{detail.defenceAdress}</p>
                            发起人:<p>{detail.defenceAuthorName}</p>
                        </div>
                    </Form>
                </div>
            </Form>
        </div>
        <div className='group_defence_detail'></div>
    </div>
}
export default scoreHistory;
